package com.bingbing.back.service.Impl;

import com.bingbing.back.dto.UserInfoDto;
import com.bingbing.back.mapper.UserInfoMapper;
import com.bingbing.back.po.StuInfo;
import com.bingbing.back.service.UserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Resource
    private UserInfoMapper userInfoMapper;
    @Override
    public StuInfo IsOurUser(String userName, String userPwd) {

        StuInfo user = null;
        user = userInfoMapper.IsOurUser(userName,userPwd);
        return user;
    }

    @Override
    public int UserReg(UserInfoDto dto) {

        int row = userInfoMapper.UserReg(dto);

        return row;
    }

    @Override
    public StuInfo UserNameStatus(String userName) {

        StuInfo user = null;

        user = userInfoMapper.UserNameStatus(userName);

        return user;
    }

    @Override
    public StuInfo UserEmailStatus(String userEmail) {

        StuInfo user = null;

        user = userInfoMapper.UserEmailStatus(userEmail);

        return user;
    }

    @Override
    public int SetLoginToken(String userName, String token) {

        int row = 0;
        row = userInfoMapper.SetLoginToken(userName,token);

        return row;
    }

    @Override
    public String GetCurrentToken(String userName) {

        String token = null;

        token = userInfoMapper.GetCurrentToken(userName);

        return token;
    }

    @Override
    public int GetVipStatus(String userName) {

        int status = userInfoMapper.GetVipStatus(userName);

        return status;
    }
}
